package com.vf.admin;
//import com.vf.admin.common.netty.NettyService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement//事务处理的时候启动类必须要加的注解
//(exclude = {DataSourceAutoConfiguration.class})  WebMvcConfigurerAdapter ServletContextInitializer
// implements WebMvcConfigurer, CommandLineRunner
//extends WebMvcConfigurerAdapter
public class BpAdminApplication extends WebMvcConfigurerAdapter {

    public static void main(String[] args) {
        SpringApplication.run(BpAdminApplication.class,args);
    }

    /**
     * 1、 extends WebMvcConfigurationSupport
     * 2、重写下面方法;
     * setUseSuffixPatternMatch : 设置是否是后缀模式匹配，如“/user”是否匹配/user.*，默认真即匹配；
     * setUseTrailingSlashMatch : 设置是否自动后缀路径模式匹配，如“/user”是否匹配“/user/”，默认真即匹配；
     */
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false)
                .setUseTrailingSlashMatch(true);
    }

    //实现CommandLineRunner 重写run方法 这里放了netty的启动
//    @Override
//    public void run(String... args) throws Exception {
//        new NettyService();
//    }
}

//jar
//@EnableScheduling
//@SpringBootApplication
//@EnableTransactionManagement//事务处理的时候启动类必须要加的注解
//public class BpAdminApplication {
//
//    public static void main(String[] args) {
//        SpringApplication.run(BpAdminApplication.class,args);
//    }
//}